
'use strict';

/**
	Part of Zombie Navigator
	Copyright © 2015  Zombie Navigator Developers
	
	@file
	@module
	@license AGPL-3.0+
*/


/* Addon SDK dependencies */
const _sdkSimplePrefs = require('sdk/simple-prefs');


/* Exported APIs */

/**
	@public
*/
const addButtonHandler = (name, handler) => {
	const sdkSimplePrefs = _sdkSimplePrefs;
	if ('function' != typeof handler) {
		throw new TypeError('Not a function');
	}
	try {
		sdkSimplePrefs.on(name + '', () => {
			handler();
		});
	} catch (e) {}
};


/* Exports */
exports.addButtonHandler = addButtonHandler;


// vim: ts=4 noet ai

